package pub.developers.forum.domain.repository;

import pub.developers.forum.common.model.PageResult;
import pub.developers.forum.domain.entity.Comment;

import java.util.Date;
import java.util.List;
import java.util.Set;


public interface CommentRepository {

    void softDelete(Long id, Date update);

    void deleteByUserId(Long userId);

    void save(Comment comment);

    //根据评论id , 拿到评论内容
    Comment get(Long id);


    List<Comment> queryByPostsId(Long postsId);

    PageResult<Comment> queryInReplyIds(Set<Long> replyIds , Integer pageSize , Integer pageNo);

    List<Comment> queryInReplyIdOrReplyReplyId(Long id);

    PageResult<Comment> page(Integer pageNo, Integer pageSize, Long postsId);

    void deleteByPostsId(Long postsId);

    List<Comment> queryInIds(Set<Long> ids);

    //给评论点赞的功能实现
    void followCommentRepository(Long userId , Long commentID);


    //取消评论点赞
    void unfollowCommentRepository(Long userId , Long commentID);

    //根据用户id 拿到用户的评论id
    Long[] getCommentIdByUserid(Long userId);

    //根据评论id , 去查看是否有人给这条评论点赞 , 如果有 , 拿到点赞的人的id
    Long[] getAllFollower(Long commentID);

    //查询前三条二级评论
    List<Comment> queryThreeInReplyIds(Set<Long> replyIds);

    List<Comment> queryInReplyIdsCount(Set<Long> replyIds);

}
